<?php
function changnumbermoney($number) {
	$stemp = "";
	for(;;) {
		if(strlen($number) > 3) {
			$ext = substr($number, -3);
			$number = substr($number, 0, -3);
			$stemp = ".".$ext.$stemp;
		} else {
			$stemp = $number.$stemp;
			break;
		}
	}
	return $stemp;
}

function stripUnicode($str){
  	if(!$str) return false;
$str = strtolower($str);
	
  	$unicode = array(
      'a'=>'á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ',
      'd'=>'đ',
      'e'=>'é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ',
      'i'=>'í|ì|ỉ|ĩ|ị',
      'o'=>'ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ',
      'u'=>'ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự',
      'y'=>'ý|ỳ|ỷ|ỹ|ỵ',
   );
   foreach($unicode as $nonUnicode=>$uni) $str = preg_replace("/($uni)/i",$nonUnicode,$str);
   return $str;
}

function rewriteTextUrl($str) {
	$str = preg_replace('/\s+/', '-', $str);
	$str = preg_replace('/_+/', '-', $str);
	$str = preg_replace('/"+/', '', $str);
	$str = preg_replace('/,+/', '', $str);

	$str = preg_replace('/\?+/', '', $str);
	return $str;
}
?>